﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Drawing;
using System.Collections;

namespace ImageEditor
{
    class StateList
    {
        #region SymbolMap
        private static String[] symbolMap = {"Alabama - AL", "Alaska - AK", "Arizona - AZ", "Arkansas - AR", "California - CA", "Colorado - CO", 
                                         "Connecticut - CT", "Delaware - DE", "Florida - FL", "Georgia - GA", "Hawaii - HI", "Idaho - ID", 
                                         "Illinois - IL", "Indiana - IN", "Iowa - IA", "Kansas - KS", "Kentucky - KY", "Louisiana - LA", 
                                         "Maine - ME", "Maryland - MD", "Massachusetts - MA", "Michigan - MI", "Minnesota - MN", "Mississippi - MS", 
                                         "Missouri - MO", "Montana - MT", "Nebraska - NE", "Nevada - NV", "New Hampshire - NH", "New Jersey - NJ", 
                                         "New Mexico - NM", "New York - NY", "North Carolina - NC", "North Dakota - ND", "Ohio - OH", "Oklahoma - OK", 
                                         "Oregon - OR", "Pennsylvania - PA", "Rhode Island - RI", "South Carolina - SC", "South Dakota - SD", 
                                         "Tennessee - TN", "Texas - TX", "Utah - UT", "Vermont - VT", "Virginia - VA", "Washington - WA", 
                                         "West Virginia - WV", "Wisconsin - WI", "Wyoming - WY"};
        #endregion

        public static String GetStateSymbol(String stateName)
        {
            foreach (var item in symbolMap)
            {
                if (item.Contains(stateName))
                {
                    String symbol = item.Split('-')[1].Trim();
                    return symbol;
                }
            }
            return "";
        }

        public static String GetStateName(String symbol)
        {
            foreach (var item in symbolMap)
            {
                if (item.Contains(symbol))
                {
                    String stateName = item.Split('-')[0].Trim();
                    return stateName;
                }
            }
            return "";
        }

        public static Dictionary<String, Color> GenerateColorKey()
        {
            Dictionary<String, Color> colorKey = new Dictionary<String, Color>();
            colorKey.Add("No Activity", Color.LightGray); 
            colorKey.Add("Sporadic", Color.LightBlue);
            colorKey.Add("Local Activity", Color.BlueViolet);
            colorKey.Add("Regional", Color.DeepSkyBlue);
            colorKey.Add("Widespread", Color.PaleVioletRed);
            return colorKey;
        }

        public static Dictionary<String, Point> GenerateStateData()
        {
            Dictionary<String, Point> stateData = new Dictionary<String, Point>();
            stateData.Add("Alabama", new Point(681, 408));
            stateData.Add("Alaska", new Point(75, 500));
            stateData.Add("Arizona", new Point(159, 338));
            stateData.Add("Arkansas", new Point(556, 379));
            stateData.Add("California", new Point(29, 178));
            stateData.Add("Colorado", new Point(288, 259));
            stateData.Add("Connecticut", new Point(907, 203));
            stateData.Add("Delaware", new Point(899, 265));
            stateData.Add("Florida", new Point(700, 497));
            stateData.Add("Georgia", new Point(731, 403));
            stateData.Add("Hawaii", new Point(252, 567));
            stateData.Add("Idaho", new Point(168, 49));
            stateData.Add("Illinois", new Point(608, 234));
            stateData.Add("Indiana", new Point(675, 247));
            stateData.Add("Iowa", new Point(520, 213));
            stateData.Add("Kansas", new Point(415, 296));
            stateData.Add("Kentucky", new Point(652, 309));
            stateData.Add("Louisiana", new Point(570, 463));
            stateData.Add("Maine", new Point(930, 68));
            stateData.Add("Maryland", new Point(830, 274));
            stateData.Add("Massachusetts", new Point(908, 182));
            stateData.Add("Michigan", new Point(623, 117));
            stateData.Add("Minnesota", new Point(512, 76));
            stateData.Add("Mississippi", new Point(618, 412));
            stateData.Add("Missouri", new Point(534, 283));
            stateData.Add("Montana", new Point(214, 52));
            stateData.Add("Nebraska", new Point(389, 222));
            stateData.Add("Nevada", new Point(99, 199));
            stateData.Add("NewHampshire", new Point(920, 129));
            stateData.Add("NewJersey", new Point(893, 232));
            stateData.Add("NewMexico", new Point(270, 354));
            stateData.Add("NewYork", new Point(809, 143));
            stateData.Add("NorthCarolina", new Point(751, 343));
            stateData.Add("NorthDakota", new Point(400, 80));
            stateData.Add("Ohio", new Point(723, 231));
            stateData.Add("Oklahoma", new Point(399, 366));
            stateData.Add("Oregon", new Point(45, 87));
            stateData.Add("Pennsylvania", new Point(799, 220));
            stateData.Add("RhodeIsland", new Point(935, 200));
            stateData.Add("SouthCarolina", new Point(771, 393));
            stateData.Add("SouthDakota", new Point(394, 152));
            stateData.Add("Tennessee", new Point(639, 360));
            stateData.Add("Texas", new Point(319, 378));
            stateData.Add("Utah", new Point(195, 222));
            stateData.Add("Vermont", new Point(897, 138));
            stateData.Add("Virginia", new Point(763, 284));
            stateData.Add("Washington", new Point(77, 28));
            stateData.Add("WestVirginia", new Point(773, 268));
            stateData.Add("Wisconsin", new Point(583, 131));
            stateData.Add("Wyoming", new Point(267, 159));
            return stateData;
        }
    }
}
